package request

// 新建零售发源地
type CreateRetailPersonInCharge struct {
	Name   string `form:"name" json:"name" binding:"required"`
	Gender string `form:"gender" json:"gender" binding:"required"`
	Phone  string `form:"phone" json:"phone" binding:"required,mobile"`
	Area   string `form:"area" json:"area"`
	Record string `form:"record" json:"record"`
}

// 自定义错误信息
func (c CreateRetailPersonInCharge) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"name.required":   "发源地名称不能为空",
		"gender.required": "负责人性别不能为空",
		"phone.required":  "负责人电话不能为空",
		"phone.mobile":    "电话号码格式不正确",
	}
}

type DeleteRetailPersonInCharge struct {
	ID string `form:"id" json:"id" binding:"required"`
}

func (del DeleteRetailPersonInCharge) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"id.required": "id不能为空",
	}
}

type EditorRetailPersonInCharge struct {
	ID     string `form:"id" json:"id" binding:"required"`
	Name   string `form:"name" json:"name" binding:"required"`
	Gender string `form:"gender" json:"gender" binding:"required"`
	Phone  string `form:"phone" json:"phone" binding:"required,mobile"`
	Area   string `form:"area" json:"area"`
	Record string `form:"record" json:"record"`
}

func (editor EditorRetailPersonInCharge) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"id.required":     "id不能为空",
		"name.required":   "负责人姓名不能为空",
		"gender.required": "负责人性别不能为空",
		"phone.required":  "负责人电话不能为空",
		"phone.mobile":    "电话号码格式不正确",
	}
}

// 新建水源负责人
type CreateWaterSourcePersonInCharge struct {
	Name   string `form:"name" json:"name" binding:"required"`
	Gender string `form:"gender" json:"gender" binding:"required"`
	Phone  string `form:"phone" json:"phone" binding:"required,mobile"`
	Area   string `form:"area" json:"area"`
	Record string `form:"record" json:"record"`
}

// 自定义错误信息
func (c CreateWaterSourcePersonInCharge) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"name.required":   "负责人姓名不能为空",
		"gender.required": "负责人性别不能为空",
		"phone.required":  "负责人电话不能为空",
		"phone.mobile":    "电话号码格式不正确",
	}
}

// 删除水源负责人
type DeleteWaterSourcePersonInCharge struct {
	ID string `form:"id" json:"id" binding:"required"`
}

func (del DeleteWaterSourcePersonInCharge) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"id.required": "id不能为空",
	}
}

type EditorWaterSourcePersonInCharge struct {
	ID     string `form:"id" json:"id" binding:"required"`
	Name   string `form:"name" json:"name" binding:"required"`
	Gender string `form:"gender" json:"gender" binding:"required"`
	Phone  string `form:"phone" json:"phone" binding:"required,mobile"`
	Area   string `form:"area" json:"area"`
	Record string `form:"record" json:"record"`
}

func (editor EditorWaterSourcePersonInCharge) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"id.required":     "id不能为空",
		"name.required":   "负责人姓名不能为空",
		"gender.required": "负责人性别不能为空",
		"phone.required":  "负责人电话不能为空",
		"phone.mobile":    "电话号码格式不正确",
	}
}
